package com.jiangxue.strategy;

public class Test {

    public static void main(String[] args) {
        //示例1
        Duck mallardDuck = new MallardDuck();
        mallardDuck.performQuack();
        mallardDuck.performFly();
        //示例2
        Duck model = new ModelDuck();
        model.performFly();
        //改变飞行行为
        model.setFlyBehavior(new FlyRocketPowered());
        model.performFly();

;    }
}